<?php include(__SITE_PATH.DS.'views/include/head.php'); ?>
<body>
<div id="wrappage">
    <div id="header" class="left">
        <?php include(__SITE_PATH.DS.'views/include/header.php');?>
    </div><!--End div.header-->
    <div id="container" class="left">
        <?php include(__SITE_PATH.DS.'views/include/sidebar.php');?>
        <div class ="content-right right">
			<?php if(isset($notice)) echo '<div class="error"><p>'.$notice.'</p></div>';?>
			<?php if(isset($success)) echo '<div class="success"><p>'.$success.'</p></div>';?>
            <form method="post" enctype="multipart/form-data" action="<?php echo Core::site_url('quanlysach/themmoisach');?>">
				<div class="accountInfo">
					<h2>Thêm mới sách theo danh mục và nhà xuất bản</h2>
					<fieldset class="login">
						<legend>Thêm mới sách</legend>
						<table class="adduser" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								<label>Chọn danh mục</label>
							</td>
							<td>
								<?php if(isset($danhmuc) && $danhmuc->num_rows !=0){?>
									<select name="cbodanhmuc" class="cboEntry">
										<option value="0">Chọn danh mục</option>
									<?php while($rowdm = $danhmuc->fetch_array()){?>
										<option value="<?php echo $rowdm['CategoryID'];?>"><?php echo $rowdm['CategoryName'];?></option>
									<?php }?>
									</select>
								<?php }?>
							</td>
						</tr>
						<tr>
							<td>
							<label>Chọn nhà xuất bản</label>
							</td>
							<td>
								<?php if(isset($nhaxuatban) && $nhaxuatban->num_rows !=0){?>
									<select name="cbonxb" class="cboEntry">
									<option value="0">Chọn nhà xuất bản</option>
									<?php while($rownxb = $nhaxuatban->fetch_array()){?>
										<option value="<?php echo $rownxb['PublisherID'];?>"><?php echo $rownxb['PublisherName'];?></option>
									<?php }?>
									</select>
								<?php }?>
							</td>
						</tr>
						<tr>
							<td>
							<label>Nhập vào tên sách</label>
							</td>
							<td>
								<input type="text" name="txttensach" class="textEntry"/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Hình ảnh của sách</label>
							</td>
							<td>
								<input type="file" name="txthinhanh" class="textEntry"/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Giá sách</label>
							</td>
							<td>
								<input type="text" name="txtgia" class="textEntry"/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Tác giả</label>
							</td>
							<td>
								<input type="text" name="txttacgia" class="textEntry"/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Năm xuất bản</label>
							</td>
							<td>
								<input type="text" name="txtnamxb" class="textEntry"/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Miêu tả sơ bộ</label>
							</td>
							<td>
								<textarea name="txtmieuta" rows="10" cols="40" class="textEntry">
								</textarea>
							</td>
						</tr>
						</table>
					</fieldset>
					<p class="submitButton">
						<input type="submit" name="btnthemsach" id="btnthemsach" value="Thêm mới" />
						<input type="reset" name="btnreset" id="btnreset" value="Nhập lại" />
					</p>
				</div>
            </form>
        </div>            
    </div><!--End div.container-->
    <div class="clear"></div>
    <div id="footer" class="left">
        <?php include(__SITE_PATH.DS.'views/include/footer.php');?>
    </div><!--End div.footer-->
</div><!--End div#wrappage-->
</body>
</html>